import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import Home from '@/views/home.vue'
import Look from '@/views/look.vue'
import Information from '@/views/information.vue'
import User from '@/views/user.vue'
import Area from '@/views/area.vue'
import HousingDetails from '@/views/housingdetails.vue'
const Map = () => import('@/views/map.vue')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [
      { path: 'home', component: Home },
      { path: 'look', component: Look },
      { path: 'information', component: Information },
      { path: 'user', component: User }
    ]
  },
  { path: '/area', component: Area },
  {
    path: '/housingdetails/:id',
    component: HousingDetails,
    name: 'HousingDetails'
  },
  {
    path: '/map',
    component: Map
  }
]

const router = new VueRouter({
  routes
})

export default router
